package main.allsort;

import main.allsort.concreate.XuanZe;

/**
 * @author: kejl
 * @create: 2020-07-17 21:05
 */
public class Client {
    public static void main(String[] args) throws ClassNotFoundException, IllegalAccessException, InstantiationException {

        //策略模式：
        SortMethod sortMethod = SortStrategy.getSortMethod(SortEnum.XuanZe);
        Integer[] result = sortMethod.sortNum(SortNum.toSort);

       // SortMethodFactory.getSortMethod("xuanze");

        SortMethod method =     (XuanZe) Class.forName("main.allsort.concreate.XuanZe").newInstance();
        result = method.sortNum(SortNum.toSort);

        for (int i = 0; i < result.length; i++) {
            System.out.println(result[i]);

        }
//        for (int num : result){
//            System.out.println(num);
//        }


    }
}
